package com.liuxing.javaSpringBoot.modules.test.service.impl;

import com.liuxing.javaSpringBoot.aop.MethodCallTimeAnnotation;
import com.liuxing.javaSpringBoot.modules.test.dao.CountryDao;
import com.liuxing.javaSpringBoot.modules.test.entity.Country;
import com.liuxing.javaSpringBoot.modules.test.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * Created by IntelliJ IDEA.
 * @File CountryServiceImpl.java
 * @Auth liuxing
 * @Date 2021/8/19 15:27
 * @Email liuxing997@foxmail.com
 */
@Service
public class CountryServiceImpl implements CountryService {

    @Autowired
    private CountryDao countryDao;

    //根据国家ID查询国家信息
    @Override
    @MethodCallTimeAnnotation
    public Country getCountryByCountryId(int countryId) {
        return countryDao.getCountryByCountryId(countryId) ;
    }

    //按国家名称获取国家信息
    @Override
    public Country getCountryByCountryName(String countryName, String localCountryName) {
        return countryDao.getCountryByCountryName(countryName, localCountryName);
    }
}
